package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.vo.CatalogCurrentVo;
import com.cskaoyan.bean.vo.CatalogIndexVo;
import com.cskaoyan.service.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :LuoXuXin
 * @version : $version
 * @date :Created in 2022/4/8   21:29
 * @description:
 * @return:
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatalogService wxCatalogService;

    @GetMapping("index")
    public BaseRespVo catalogIndex() {
        CatalogIndexVo catalogIndexVo = wxCatalogService.queryAllCatalog();
        return BaseRespVo.ok(catalogIndexVo);
    }

    @GetMapping("current")
    public BaseRespVo catalogCurrent(Integer id) {
        CatalogCurrentVo catalogCurrentVo = wxCatalogService.queryOneCatalog(id);
        return BaseRespVo.ok(catalogCurrentVo);
    }
}
